import Dexie from 'dexie';

const DATABASE = 'MyDatabase';

// 配置表
export const DB_SETTING = () => {
  const db = new Dexie(DATABASE);
  if (!db.setting) {
    db.version(1).stores({
      setting: '++id, *key, value', // "++id, name, age, *tags",
      gameSessions: 'key',
    });
  }
  return db.setting;
}

export const DB = () => {
  return new Dexie(DATABASE);
}

